@use 'sass:map';
@use '@angular/material' as mat;
@use './model/entity/structure/structure-theme' as structure;
@use './model/entity/cube-structure/cube-structure-theme' as cube-structure;
@use './model/entity/calculation//calculation-theme' as calculation;
@use './model/model-theme' as model;
@use './tables-join/tables-join-theme' as tables-join;

@mixin color($theme) {
  $config: mat.get-color-config($theme);

  $primary-palette: map.get($config, 'primary');
  $accent-palette: map.get($config, 'accent');
  $background: map.get($config, background);
  $foreground: map.get($config, foreground);

  @include structure.color($theme);
  @include cube-structure.color($theme);
  @include calculation.color($theme);
  @include model.color($theme);
  @include tables-join.color($theme);
}

@mixin typography($theme) {
  @include structure.typography($theme);
  @include cube-structure.typography($theme);
  @include calculation.typography($theme);
}

@mixin density($theme) {
  @include structure.density($theme);
  @include cube-structure.density($theme);
  @include calculation.density($theme);
  @include model.density($theme);
  @include tables-join.density($theme);


  .ngm-tree-table {
    .mat-mdc-cell {
      @apply whitespace-nowrap;
    }
  }
}

@mixin theme($theme) {
  $color: mat.get-color-config($theme);
  $density: mat.get-density-config($theme);
  $typography: mat.get-typography-config($theme);

  @if $color != null {
    @include color($color);
  }
  @if $density != null {
    @include density($density);
  }
  @if $typography != null {
    @include typography($typography);
  }
}
